package com.zy.transaction.service;

import com.zy.transaction.dao.TransferDao;

public class TransferServiceImpl implements TransferService{
    private TransferDao transferDao;

    public void setTransferDao(TransferDao transferDao) {
        this.transferDao = transferDao;
    }
    /**
     * @param source 支出方账户名称
     * @param name 收入方账户名称
     * @param amount 转账金额
     */
    @Override
    public void transferMoney(String source, String destination, Long amount) {
        transferDao.payMoney(source, amount);
        int i = 100;//此处用于测试抛异常时是否会回滚
        transferDao.collectMoney(destination, amount);
    }
}
